package com.example.day4retrofit;


import java.util.Map;

import io.reactivex.Observable;
import io.reactivex.Observer;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface Api {

    @GET("dish_list.php")
    Observable<XiaEntity> getData (@QueryMap Map<String,Integer>  map);

    @GET("dish_list.php")
    Observable<XiaEntity> getData(@Query("stage_id") int stageId,@Query("limit") int limit,@Query("page") int page);


    @FormUrlEncoded  //表单提交
    @POST("user/login")
    Observable<String> getlogin(@Field("username") String username,@Field("password") String password);

    @POST("user/register")
    Observable<String> geregster(@Body RequestBody requestBody);



}
